package controller

import (
	"context"

	"demo/internal/service"

	"github.com/gogf/gf/v2/frame/g"

	v1 "demo/api/v1"
)

var (
	User = cUser{}
)

type cUser struct{}

func (c *cUser) Profile(ctx context.Context, req *v1.ProfileReq) (res *v1.ProfileRes, err error) {
	res = &v1.ProfileRes{
		User: service.User().GetProfile(ctx, req.Openid),
	}
	return
}

func (c *cUser) UpdateNickName(ctx context.Context, req *v1.UpdateReq) (res *v1.UpdateRes, err error) {
	g.RequestFromCtx(ctx).Response.Writeln("UpdateNickName!!!")
	return
}
